package config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

//swagg配置
@Configuration
public class SwaggerConfig {
    @Bean
    public Docket ctreateRestApi() {
        //摘要对象
        Docket docket =new Docket(DocumentationType.OAS_30);
        docket.apiInfo(apiInfo())
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.suece.demo119.controller"))
                .build();
        return docket;
    }

    private ApiInfo apiInfo() {
        return new ApiInfoBuilder()
                .title("接口文档")
                .description("我是描述信息")
                .contact(new Contact("陈雨薇","http://www.cyw.cn","3493765427@qq.com"))
                .version("版本号：V.1")
                //协议
                .license("The Apache License")
                .licenseUrl("http://www.baidu.com")
                .build();
    }
}
